package book;

public class Book {
    private String name;
    private String author;
    private double price;
    private boolean isBorrewd;

    public Book(String name, String author, double price) {
        this.name = name;
        this.author = author;
        this.price = price;
    }

    public Book() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean isBorrewd() {
        return isBorrewd;
    }

    public void setBorrewd(boolean borrewd) {
        isBorrewd = borrewd;
    }

    @Override
    public String toString() {

        String ret = name + "        " +author + "        " +price ;

        if(isBorrewd()){
            ret+="     已借出";
        }
        else{
            ret+="     未借出";
        }
        return ret;
    }
}
